home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_shs_cutsceneicemonster.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  118 lines

  1. # Jones 3D Cog Script
  2. #
  3. # SHS_CutsceneIceMonster.cog
  4. #
  5. # [PKM]
  6. #
  7. # For the cutscene version of the sticky ice monster only!  He'll jump off wall or ceiling in
  8. # response to a user 0 message.
  9. #
  10. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  11. #
  12. # ========================================================================================
  13.  
  14. symbols
  15.  
  16.     message        startup
  17.     message        user0
  18.     message        user1
  19.     message        aievent
  20.  
  21.     sound        detachSound=fol_si_detach.wav            local
  22.  
  23.     thing        stickyChicken
  24.     thing        positionGhost
  25.  
  26.     template    newMonster=ice_monster                    local
  27.     template    iceSprShower=+ice_spr_exp_blast            local
  28.     template    iceShowerSmall=+ice_exp_blast_sm        local
  29.     template    iceShower=+ice_exp_blast                local
  30.     template    iceBlast=+ice_spr_exp_cloud                local
  31.     template    iceCloud=+ice_exp_cloud                    local
  32.     template    iceShards=+ice_spr_exp_shards            local
  33.     template    explosionParticlesA=+IceChickenExplA    local
  34.     template    explosionParticlesB=+IceChickenExplB    local
  35.     template    explosionParticlesC=+IceChickenExplC    local
  36.     template    explosionParticlesD=+IceChickenExplD    local
  37.  
  38.     thing        newMonsterRef=-2                        local
  39.  
  40.     vector        lookVectorPYR                            local
  41.     vector        newMonsterPos                            local
  42.     
  43.     int            floordistance                            local
  44.     int            thingPos                                local    
  45.  
  46. end
  47.  
  48. # ========================================================================================
  49.  
  50. code
  51.  
  52. startup:
  53.     AISetCutsceneMode(stickyChicken);
  54.     SetActorFlags(stickyChicken, 0x100008);
  55.     return;
  56.  
  57. # ........................................................................................
  58.  
  59. user0:
  60.     // In response to a user0 message, we need to detach and fall.
  61.  
  62.     PlaySoundThing(detachSound, stickyChicken, 1.0, 0.1, 10.0, 0x80);
  63.     DetachThing(stickyChicken);
  64.  
  65.     floorDistance = CheckFloorDistance(stickyChicken);
  66.     thingPos = GetThingPos(stickyChicken);
  67.     thingPos = vectorSet(vectorX(thingPos), vectorY(thingPos), vectorZ(thingPos) - floorDistance);
  68.     SetPhysicsFlags(stickyChicken, 0x2000);
  69.  
  70.     AIClearCutsceneMode(stickyChicken);
  71.     AISetMovePos(stickyChicken, thingPos, 0);
  72.     AISetMoveSpeed(stickyChicken, 0.50);
  73.  
  74.     return;
  75.  
  76. user1:
  77.     // When we're sent a user1 message, it's time for the ice chicken to run to his new position.
  78.     CaptureThing(newMonsterRef);
  79.     AISetLookThing(newMonsterRef, positionGhost);
  80.     AISetMovePos(newMonsterRef, GetThingPos(positionGhost), 0);
  81.     AISetMoveSpeed(newMonsterRef, 3.0);
  82.  
  83.     return;
  84.  
  85. aievent:
  86.     if ((GetSenderRef() == stickyChicken) && BITTEST(GetParam(0), 0xe04))
  87.     {
  88.         // We've reached our movement goal, or we hit a wall, floor, or thing - explode!
  89.  
  90.         lookVectorPYR = GetThingLVecPYR(stickyChicken);
  91.         lookVectorPYR = VectorSet(0, VectorY(lookVectorPYR), VectorZ(lookVectorPYR));
  92.  
  93.         newMonsterPos = VectorSet(VectorX(thingPos), VectorY(thingPos), VectorZ(thingPos) + 0.05);
  94.  
  95.         newMonsterRef = CreateThingAtPos(newMonster, GetThingSector(stickyChicken), newMonsterPos, lookVectorPYR);
  96.         SetActorFlags(newMonsterRef, 0x8);
  97.         AISetCutsceneMode(newMonsterRef);
  98.         CreateThing(iceShowerSmall, stickyChicken);
  99.  
  100.         DestroyThing(stickyChicken);
  101.         stickyChicken = -1;
  102.  
  103.         return;
  104.     }
  105.  
  106.     if ((GetSenderRef() == newMonsterRef) && BITTEST(GetParam(0), 0x800))
  107.     {
  108.         ReleaseThing(newMonsterRef);
  109.         DestroyThing(newMonsterRef);
  110.         newMonsterRef = -2;
  111.         return;
  112.     }
  113.  
  114.     return;
  115.  
  116. end
  117.  
  118.